var LEFT = 1,RIGHT = 2,UP = 3,DOWN = 4,STATIC = 0;

var con = $("#content");
var page = Swipe(con);

var conWidth = con.width();
var conHeigth = con.height();

var pageA_middle_height = (function(){
	    var data = getValue('.a_background_middle');
      return data.top + data.height/2;
})();



/*pageA*/
/*男孩运动*/
var boy = new Boy($("#boy"));
var boytop = pageA_middle_height-boy.height+25;
var boyleft = 0;

boy.setPos(boytop ,boyleft);

boy.dynamic("dynamic");

var door = new Door($(".door").eq(0));
var girl = new Girl($('.girl').eq(0));

var door_left = door.left;
var  url = "music/happy.wav";
var  url1 = "music/circulation.wav";
var  audio = new Audio(url);
audio.loop = "loop" || false;
audio.play();


page.scrollTo(conWidth,13000);
bird.fly(20000);
boy.walkTo(door_left,boy.getPos().top,11000).then(function(){
    return boy.stopWalk(1500);
}).then(function(){
    lamp.bright();
    return door.open(6000);
}).then(function(){
    return boy.inShop(5000);
}).then(function(){
    return  boy.outShop(3000);
}).then(function(){
   lamp.dark();
   return door.close(6000);
}).then(function(){
   page.scrollTo(conWidth*2,10000);
   return boy.walkTo( 80,boy.getPos().top,8500)
}).then(function(){
  return boy.stopWalk(1500);
}).then(function(){
  return boy.walkTo(girl.left-boy.width+29,girl.top,4000);
}).then(function(){
   audio.src  = url1;
   audio.play();
  return boy.stopWalk(0);
}).then(function(){
   boy.rotate();
   girl.rotate();
   fallFlowers(5,6)
})






